-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.java
37 lines (24 loc) · 904 Bytes
/
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
int notas, aux;
notas = sc.nextInt();
System.out.println(notas);
System.out.println(notas / 100 + " nota(s) de R$ 100,00");
aux = (notas % 100);
System.out.println(aux / 50 + " nota(s) de R$ 50,00");
aux = (aux % 50);
System.out.println(aux / 20 + " nota(s) de R$ 20,00");
aux = (aux % 20);
System.out.println(aux / 10 + " nota(s) de R$ 10,00");
aux = (aux % 10);
System.out.println(aux / 5 + " nota(s) de R$ 5,00");
aux = (aux % 5);
System.out.println(aux / 2 + " nota(s) de R$ 2,00");
aux = (aux % 2);
System.out.println(aux + " nota(s) de R$ 1,00");
sc.close();
}
}